umbraco.library:GetPreValueAsString({0}) Not working
Hi,
I've set up a radio button list on a document type that allows users to select from this list when they're creating content. What i'm trying to do is display what they've selected so in the Template I've entered.
But this only displays the ID of the item in the radiobutton list but I'd like to display the actual text of the radiobutton option. So after searching the forums I've changed my code to this. But this doesn't actually display anything.
I am using Umbraco 6.1.6 running on a SQLCE database. If you could provide more infomation about which version of Umbraco that you´re running, then I will try to see, if I can reproduce the same as you.
I think there might be a bug in version 4,9,1 on the Radio button list and it´s prevalue. If you need it you could upgrade your Umbraco installation if possible, if an upgrade isn't possible a workaround be using a Checkbox list instead of the Radio button list.
By change it to a checboxlist I have not managed to getinlineXSLTto work, but you can make an XSLT file an place it´s macro where the value should apear or you can pull out the data by just using the <umbraco:Item> as I show above.
umbraco.library:GetPreValueAsString({0}) Not working
Hi,
I've set up a radio button list on a document type that allows users to select from this list when they're creating content. What i'm trying to do is display what they've selected so in the Template I've entered.
But this only displays the ID of the item in the radiobutton list but I'd like to display the actual text of the radiobutton option. So after searching the forums I've changed my code to this. But this doesn't actually display anything.
Can anyone shed any light please?
Thanks,
Craig
Hi Craig,
I have no problems getting the actual text of the radiobutton option to display, by usig this code:
<umbraco:Item runat="server" field="templateType" xslt="umbraco.library:GetPreValueAsString({0})"/>
So on the frontend I get Option 1 outputted.
I am using Umbraco 6.1.6 running on a SQLCE database. If you could provide more infomation about which version of Umbraco that you´re running, then I will try to see, if I can reproduce the same as you.
/Dennis
Hi Dennis,
Thanks for the response. The install that I'm running is 4.9.1 with a SQL backend.
This looks more or less identical to what you've got, but nothing gets displayed.
Thanks for your time.
Craig
Hi Craig,
I have just tried to setup the same setup as you, and I can confirm it´s only displays the ID when you are using
And nothing if you´re using the inline xslt version:
I think there might be a bug in version 4,9,1 on the Radio button list and it´s prevalue. If you need it you could upgrade your Umbraco installation if possible, if an upgrade isn't possible a workaround be using a Checkbox list instead of the Radio button list.
You can pull out data like:
or
By change it to a checbox list I have not managed to get inline XSLT to work, but you can make an XSLT file an place it´s macro where the value should apear or you can pull out the data by just using the <umbraco:Item> as I show above.
Hope this can help you.
/Dennis
Hi Dennis,
Just to let you know that changing the selector to a dropdown list solved the problem as you thought it might :)
Thanks for your time and help....top man.
Craig
Hi Craig,
Good to hear. I´m glad that I could help you.
I think that you should mark this topic as solved, so other searching for the same issue can see what worked for you.
/Dennis
is working on a reply...